{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
\f3\fnil\fcharset77 Monaco;}
{\colortbl;\red255\green255\blue255;\red191\green0\blue0;\red0\green0\blue191;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs44 \cf0 Gendy5
\f1\b0\fs24 \
\
This is a non-interpolating version of Nick Collins's Gendy1 UGen.  My idea was to use it as a kind of sample and hold jitter UGen.  It works quite well in that context, and is not a bad sound generator in its own right.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b \cf0 \ul \ulc0 Class Methods
\f1\b0 \ulnone \
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b \cf0 *ar(ampdist=1, durdist=1, adparam=1.0, ddparam=1.0, minfreq=20, maxfreq=1000, ampscale= 0.5, durscale=0.5, initCPs=12, knum=12, mul=1.0, add=0.0)\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\b0 \cf0 \
See 
\f0\b Gendy1
\f1\b0  for explanation of parameters.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f2\i \cf0 Examples\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f3\i0\fs18 \cf0 	\
	\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\fs26 \cf0 //warning- if you have lots of CPs and you have fast frequencies, the CPU cost goes up a lot because a new CP move happens every sample!
\fs18 	\
\
\cf2 //defaults	\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar)\}.play\
\
//sorry Xenakis!!!\
\cf2 (\cf0 \
\cf3 var\cf0  scale, buffer;\
scale = \cf3 FloatArray\cf0 [0, 2, 4, 6, 7, 9, 11]; \cf2 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\cf0 buffer = Buffer.alloc(s, scale.size,1, \{|b| b.setnMsg(0, scale) \});\
\
play(\{\
	\cf3 var\cf0  mix;\
	mix = \
	\cf3 SinOsc\cf0 .ar(\
		(\
			\cf3 DegreeToKey\cf0 .kr(\
				buffer.bufnum,\
				\cf3 Gendy5.kr(minfreq:1, maxfreq:8, ampscale:0.1, durscale:0.1, initCPs:3, mul:7.5, add:7.5)\cf0 ,\
				12,					\
				1,				\
				60					\
			) \
			+ \cf3 LFNoise1\cf0 .kr([3,3], 0.04)\
		).midicps,						\
		0).cubed * 0.1\
	+ \cf3 RLPFD\cf0 .ar(\cf3 LFPulse\cf0 .ar([48,55].midicps, 0.15),\
		\cf3 Gendy4\cf0 .kr(2, 2, 1, 1, 0.1, 0.2, 0.1, 0.1, 2, mul:10, add:72).midicps, 0.6, 0.2);\
	\cf3 CombN\cf0 .ar(mix, 0.31, 0.31, 2, 0.2, mix)\
\})\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\cf2 )\cf0 \
\
\cf2 //wandering bass/ powerline\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(1,1,1.0,1.0,30,100,0.3,0.05,5))\}.play\
\
\cf2 //play me	\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 RLPF\cf0 .ar(\cf3 Gendy5\cf0 .ar(2,3,minfreq:20, maxfreq:MouseX.kr(100,1000), durscale:0.0, initCPs:40), 500,0.3, 0.2), 0.0)\}.play\
\
\cf2 //scream! - careful with your ears for this one!\cf0 \
(\
\{\
\cf3 var\cf0  mx, my;\
\
mx= \cf3 MouseX\cf0 .kr(220,440);\
my= \cf3 MouseY\cf0 .kr(0.0,1.0);\
\
\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(2,3,1,1,minfreq:mx, maxfreq:8*mx, ampscale:my, durscale:my, initCPs:7, mul:0.3), 0.0)\}.play\
)\
\
\
\cf2 //1 CP = random noise effect\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(initCPs:1))\}.play\
\
\cf2 //2 CPs = suudenly an oscillator (though a fast modulating one here)\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(initCPs:2))\}.play\
\
\
\cf2 //used as an LFO	\cf0 \
(\
\{\cf3 Pan2\cf0 .ar(\cf3 SinOsc\cf0 .ar(\cf3 Gendy5\cf0 .kr(2,4,\cf3 SinOsc\cf0 .kr(0.1,0,0.49,0.51),\cf3 SinOsc\cf0 .kr(0.13,0,0.49,0.51), 3.4,3.5, \cf3 SinOsc\cf0 .kr(0.17,0,0.49,0.51), \cf3 SinOsc\cf0 .kr(0.19,0,0.49,0.51),10,10,50, 350), 0, 0.3), 0.0)\}.play\
)\
\
DegreeToKey\
	\
\cf2 //wasp\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(0, 0, \cf3 SinOsc\cf0 .kr(0.1, 0, 0.1, 0.9),1.0, 50,1000, 1,0.005, 12, 12, 0.2), 0.0)\}.play\
\
\
\cf2 //modulate distributions\cf0 \
\cf2 //change of pitch as distributions change the duration structure and spectrum\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(\cf3 MouseX\cf0 .kr(0,7),\cf3 MouseY\cf0 .kr(0,7),mul:0.2), 0.0)\}.play\
\
\
\cf2 //modulate num of CPs\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(knum:\cf3 MouseX\cf0 .kr(1,13),mul:0.2), 0.0)\}.play\
\
\
\cf2 //Gendy into Gendy...with cartoon side effects\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(maxfreq:\cf3 Gendy5\cf0 .kr(5,4,0.3, 0.7, 0.1, \cf3 MouseY\cf0 .kr(0.1,10), 1.0, 1.0, 5,5, 500, 600), knum:\cf3 MouseX\cf0 .kr(1,13),mul:0.2), 0.0)\}.play\
\
\
\cf2 //use SINUS to track any oscillator and take CP positions from it, use adparam and ddparam as the inputs to sample \cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(6,6,\cf3 LFPulse\cf0 .kr(100, 0, 0.4, 1.0), \cf3 SinOsc\cf0 .kr(30, 0, 0.5),mul:0.2), 0.0)\}.play\
\
\
\cf2 //try out near the corners especially\cf0 \
\{\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(6,6,\cf3 LFPulse\cf0 .kr(\cf3 MouseX\cf0 .kr(0,200), 0, 0.4, 1.0), \cf3 SinOsc\cf0 .kr(\cf3 MouseY\cf0 .kr(0,200), 0, 0.5),mul:0.2), 0.0)\}.play\
\
\
\cf2 //texture\cf0 \
(\
\{\
\cf3 Mix.fill\cf0 (10,\{\
\cf3 var\cf0  freq;\
\
freq= rrand(130,160.3);\
\cf3 Pan2\cf0 .ar(\cf3 SinOsc\cf0 .ar(\cf3 Gendy5\cf0 .ar(6.rand,6.rand,\cf3 SinOsc\cf0 .kr(0.1,0,0.49,0.51),\cf3 SinOsc\cf0 .kr(0.13,0,0.49,0.51),freq ,freq, \cf3 SinOsc\cf0 .kr(0.17,0,0.49,0.51), \cf3 SinOsc\cf0 .kr(0.19,0,0.49,0.51), 12, 12, 200, 400), 0, 0.1), 1.0.rand2)\
\});\
\}.play\
)\
\
\cf2 //wahhhhhhhh- try durscale 1.0 and 0.0 too\cf0 \
(\
\{\cf3 Pan2\cf0 .ar(\
\cf3 CombN\cf0 .ar(\
\cf3 Resonz\cf0 .ar(\
\cf3 Gendy5\cf0 .ar(2,3,minfreq:1, maxfreq:\cf3 MouseX\cf0 .kr(10,700), durscale:0.1, initCPs:10),\
\cf3 MouseY\cf0 .kr(50,1000), 0.1)\
,0.1,0.1,5, 0.6\
)\
, 0.0)\}.play\
)\
\
\
\cf2 //overkill\cf0 \
(\
\{\
\cf3 var\cf0  n;\
n=10;\
\
\cf3 Mix.fill\cf0 (n,\{\
\cf3 var\cf0  freq, numcps;\
\
freq= rrand(130,160.3);\
numcps= rrand(2,20);\
\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(6.rand,6.rand,1.0.rand,1.0.rand,freq ,freq, 1.0.rand, 1.0.rand, numcps, \cf3 SinOsc\cf0 .kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2)\
\});\
\}.play\
)\
\
\
\
\
\
\cf2 //another traffic moment\cf0 \
(\
\{\
\cf3 var\cf0  n;\
n=10;\
\
Resonz.ar(\
\cf3 Mix.fill\cf0 (n,\{\
\cf3 var\cf0  freq, numcps;\
\
freq= rrand(50,560.3);\
numcps= rrand(2,20);\
\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(6.rand,6.rand,1.0.rand,1.0.rand,freq ,freq, 1.0.rand, 1.0.rand, numcps, \cf3 SinOsc\cf0 .kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2)\
\})\
,MouseX.kr(100,2000), MouseY.kr(0.01,1.0))\
;\
\}.play\
)\
\
\
\
\
(\
\{\
\cf3 var\cf0  n;\
n=15;\
\
\cf3 Out\cf0 .ar(0,\
\cf3 Resonz\cf0 .ar(\
\cf3 Mix.fill\cf0 (n,\{\
\cf3 var\cf0  freq, numcps;\
\
freq= rrand(330,460.3);\
numcps= rrand(2,20);\
\cf3 Pan2\cf0 .ar(\cf3 Gendy5\cf0 .ar(6.rand,6.rand,1.0.rand,1.0.rand,freq,\cf3 MouseX\cf0 .kr(freq,2*freq), 1.0.rand, 1.0.rand, numcps, \cf3 SinOsc\cf0 .kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2)\
\})\
,\cf3 MouseX\cf0 .kr(100,2000), \cf3 MouseY\cf0 .kr(0.01,1.0))\
)\
\
\}.play;\
)\
}